package luj.game.robot.internal.start.listener;

import luj.cluster.api.actor.Tellable;
import luj.game.robot.api.boot.RobotStartListener;
import luj.game.robot.api.network.http.RobotHttpModule;
import luj.game.robot.internal.admin.message.internal.http.ReceiveHttpMsg;
import luj.game.robot.internal.net.http.collect.HandleMap;

import java.util.List;
import java.util.Map;

final class INHttpImpl implements RobotStartListener.Http {

  @Override
  public String getUri() {
    return _handler.getUri();
  }

  @Override
  public RobotHttpModule getModule() {
    return _handler.getModule();
  }

  @Override
  public void receive(Map<String, List<String>> reqParam, Object recvParam) {
    _adminRef.tell(new ReceiveHttpMsg(getUri(), reqParam, recvParam));
  }

  HandleMap.Handler _handler;

  Tellable _adminRef;
}
